import moduleRoutes from './router.config'

/**
 * 动态路由
 */
export const asyncRouters = [
  {
    path: '/',
    name: 'Dashboard',
    component: () => import('@/layout/index.vue'),
    redirect: '/analysis',
    meta: {
      title: 'Dashboard',
      permission: ['admin', 'user'],
    },
    children: [
      {
        name: 'Analysis',
        path: '/analysis',
        component: () => import('@/views/dashboard/analysis/index.vue'),
        meta: {
          title: '分析页',
          affix: true,
          permission: ['admin', 'user'],
        },
      },
      {
        name: 'Workbench',
        path: '/workbench',
        component: () => import('@/views/dashboard/workbench/index.vue'),
        meta: {
          title: '工作台',
          permission: ['admin', 'user'],
        },
      },
    ],
  },
  ...moduleRoutes,
]

/**
 * 基础路由
 */
export const baiscRouters = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
  },
  {
    name: '404',
    path: '/404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      title: '404',
    },
  },

  // { path: '/:pathMatch(.*)*', redirect: '/404', hidden: true },
]
